package edu.ustb.efws.base.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.util.Date;
import java.util.Objects;

/**
 * 原因
 *
 * @author TS Group
 */
@ApiModel("风险原因")
public class Reason {
    @ApiModelProperty("编号")
    private Integer id;
    @ApiModelProperty("0代表电流和电压，1代表温度和湿度")
    private Integer type;
    @ApiModelProperty("下限报警分数")
    private Integer lowerScore;
    @ApiModelProperty("上限报警分数")
    private Integer upperScore;
    @ApiModelProperty("原因")
    private String reason;
    @ApiModelProperty("措施")
    private String measure;
    @ApiModelProperty("创建时间")
    private Date createTime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getLowerScore() {
        return lowerScore;
    }

    public void setLowerScore(Integer lowerScore) {
        this.lowerScore = lowerScore;
    }

    public Integer getUpperScore() {
        return upperScore;
    }

    public void setUpperScore(Integer upperScore) {
        this.upperScore = upperScore;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public String getMeasure() {
        return measure;
    }

    public void setMeasure(String measure) {
        this.measure = measure;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Reason reason1 = (Reason) o;
        return Objects.equals(id, reason1.id) &&
                Objects.equals(type, reason1.type) &&
                Objects.equals(lowerScore, reason1.lowerScore) &&
                Objects.equals(upperScore, reason1.upperScore) &&
                Objects.equals(reason, reason1.reason) &&
                Objects.equals(measure, reason1.measure) &&
                Objects.equals(createTime, reason1.createTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, type, lowerScore, upperScore, reason, measure, createTime);
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("id", id)
                .append("type", type)
                .append("lowerScore", lowerScore)
                .append("upperScore", upperScore)
                .append("reason", reason)
                .append("measure", measure)
                .append("createTime", createTime)
                .toString();
    }
}
